﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PIT.Labs.ProjectRepository.Owl2DotNet
{
    /// <summary>
    /// Represents a generic property.
    /// <seealso cref="IDataProperty"/>
    /// <seealso cref="IObjectProperty"/>
    /// <seealso cref="IAnnotationProperty"/>
    /// </summary>
    /// <typeparam name="H">Type of the super and sup properties (hierarchy)</typeparam>
    /// <typeparam name="D">Type of the domain</typeparam>
    /// <typeparam name="R">Type of the range</typeparam>
    public interface IProperty<H, D, R> : IEntity where  D : IEntity where H : IProperty<H, D, R>
    {
        /// <summary>
        /// Get the sub properties
        /// </summary>
        H SubProperties
        {
            get;
        }

        /// <summary>
        /// Get the super properties
        /// </summary>
        H SuperProperties
        {
            get;
        }

        /// <summary>
        ///Get the domain. The domain is the union of the given elements.
        /// </summary>
        IEnumerable<D> Domain
        {
            get;
        }

        /// <summary>
        /// Get the range. The range is the union of the given elements.
        /// </summary>
        IEnumerable<R> Range
        {
            get;
        }

        /// <summary>
        /// Get properties that hold for this property
        /// </summary>
        PropertyCharacteristics Characteristics
        {
            get;
        }
    }

    /// <summary>
    /// Possible characteristics of a property
    /// </summary>
    [Flags]
    public enum PropertyCharacteristics
    {
        /// <summary>
        /// None
        /// </summary>
        None=0,

        /// <summary>
        /// Functional
        /// </summary>
        Functional=1,

        /// <summary>
        /// Inverse functional
        /// </summary>
        InverseFunctional=2,

        /// <summary>
        /// Transitive
        /// </summary>
        Transitive=4,

        /// <summary>
        /// Symmetric
        /// </summary>
        Symmetric=8,

        /// <summary>
        /// Asymmetric
        /// </summary>
        Asymmetric=16,

        /// <summary>
        /// Reflexive
        /// </summary>
        Reflexive=32,

        /// <summary>
        /// Irreflexive
        /// </summary>
        Irreflexive=64
    }
}
